<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * Asset Manager
 *
 * Software to automatically manage how assets are delivered on a website
 *
 * @package		Asset Manager
 * @author		Adam Lewis <adam.lewis@bestservedcold.com>
 * @copyright	Copyright (c) 2006 - 2012, Best Served Cold Media Limited.
 * @license		http://bestservedcold.com/license.html
 * @link		http://bestservedcold.com
 * @since		Version 1.0
 * @filesource
 */

// ------------------------------------------------------------------------

/**
 * Optimize Library
 *
 * The Handler library deals with getting the information in and out of the
 * CDN.
 *
 * @package		Asset Manager
 * @subpackage	Optimize
 * @category	Libraries
 * @author  	Adam Lewis <adam.lewis@bestservedcold.com>
 * @since		2012-05-22
 */
abstract class Am_optimize {

	protected $CI;

	public function construct()
	{
		log_message('debug', '[ASSETS] Class initialized');
		$this->CI =& get_instance();
	}

	protected function check_if_compressed($file)
	{
		// Check that the file isn't already compressed
		return preg_match('/^\.compressed\./', pathinfo($asset['file'], PATHINFO_FILENAME));
	}

	protected function get_optimized_filename($file)
	{
		return pathinfo($asset['file'], PATHINFO_DIRNAME).'/'.pathinfo($asset['file'],	PATHINFO_BASENAME).
			'.optimized.'.pathinfo($asset['file'], PATHINFO_EXTENSION);
	}

	protected function get_absolute_location($file)
	{
		return $_SERVER['DOCUMENT_ROOT'].'/'.$file;
	}

	protected function get_file_type($file)
	{
		switch (pathinfo($file, PATHINFO_EXTENSION))
		{

		}
	}

	protected function queue($file)
	{

	}

	protected function process($file)
	{

	}

	private function base64($file)
	{

	}
}